Linux | 您所在的位置:网站首页 › Apache 与tomcat集成部署 › Linux |
修改apache的配置文件,多个域名解析到同一个服务器上,使用apache做代理,通过域名将请求转发到不同的端口,可以为每个网站构建一个配置文件,放置在conf.d文件夹下面,比如: //example1.conf ProxyPreserveHost On ProxyPass / http://127.0.0.1:5000/ ProxyPassReverse / http://127.0.0.1:5000/ ServerName example1.com ServerAlias *.example1.com ErrorLog logs/example1-error.log CustomLog logs/example1-access.log common 复制代码 //example2.conf ProxyPreserveHost On ProxyPass / http://127.0.0.1:5555/ ProxyPassReverse / http://127.0.0.1:5555/ ServerName example2.com ServerAlias *.example2.com ErrorLog logs/example2-error.log CustomLog logs/example2-access.log common 复制代码域名解析,example1.com,example2.com都解析到当前的服务器上即可。 配置完成之后,重启httpd服务。 service httpd restart 复制代码启动.net服务,可以直接运行服务,也可以使用docker。 dotnet project.dll 复制代码或者在/etc/systemd/system路径下创建一个服务文件,比如:example.service。 [Unit] Description=Example .NET Web API App running on CentOS 7 [Service] WorkingDirectory=/home/ToolApp/bin/Release/net6.0/publish ExecStart=/usr/bin/dotnet /home/example/bin/Release/net6.0/publish/example.dll [Install] WantedBy=multi-user.target 复制代码 |
CopyRight 2018-2019 实验室设备网 版权所有 |